package com.zhou.kotlin_car_data_list.ui

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import com.zhou.kotlin_car_data_list.R

class MainActivity : AppCompatActivity(), View.OnClickListener {

    lateinit var btn1: Button
    lateinit var btn2: Button
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        btn1 = findViewById(R.id.button_1)
        btn2 = findViewById(R.id.button_2)

        btn1.setOnClickListener(this)
        btn2.setOnClickListener(this)

    }

    override fun onClick(view: View?) {
        when (view) {
            btn1 -> {
                // TODO 跳转到logoActivity页面
                val logoIntent = Intent(this, LogoActivity::class.java)
                startActivity(logoIntent)
            }

            btn2 -> {

            }
            else -> {

            }
        }
    }
}